using UnityEngine;
using System.Collections;

public enum LevelEventType
{
	None = 0,
	MusicPlayer = 1
}

public class LevelEvent
{
	public Level relatedLevel;
	public Vector2 centerPosition;
	public int radius = -1; //trigger levelEvent when player enter the circle
	protected bool started = false;
	
	public virtual LevelEventType GetEventType()
	{
		return LevelEventType.None;
	}
	
	public virtual void TriggerEvent()
	{
		if(!started)
		{
			//Do Nothing
			started = true;
		}
	}
}


public class MusicPlayerLevelEvent : LevelEvent
{
	public string fileName;
	
	public override LevelEventType GetEventType ()
	{
		return LevelEventType.MusicPlayer;
	}
	
	public override void TriggerEvent()
	{
		if(!started)
		{
			relatedLevel.PlayAudio(fileName, centerPosition);
			started = true;
		}
	}
}